from atiar import models, views

from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.views.generic import ListView

admin.autodiscover()

urlpatterns = patterns('',
    #url(r'^$', 'caips.atiar.views.index', name='index'),
    url(r'^$', 'caips.atiar.views.make_initial_request', name='index'),
    url(r'^contact/$', 'caips.atiar.views.contact', name='contact'),
    url(r'^whyneed/$', 'caips.atiar.views.whyneed', name='whyneed'),
    url(r'^webest/$', 'caips.atiar.views.webest', name='webest'),
    
    url(r'^request/thanks/$', 'caips.atiar.views.thnx_req', name='thnx_req'),
    url(r'^request/thanks/payment/$', 'caips.atiar.views.thnx_payment', name='thnx_payment'),
    url(r'^request/not_found/$', 'caips.atiar.views.request_not_found', name='request_not_found'),
    url(r'^request/(?P<reference_key>\w+)/$', 'caips.atiar.views.request_status', name='request_status'),
    url(r'^request/payment/(?P<reference_key>\w+)/$', 'caips.atiar.views.request_do_payment', name='request_do_payment'),
    
    #url(r'^agent/cabinet/$', 'caips.atiar.views.agent_index', name='agent_index'),
    url(r'^agent/$', views.ServiceRequestListView.as_view(), name='agent_index'),
    #url(r'^agent/cabinet/(?P<sr_id>\d+)/$', 'caips.atiar.views.request_detail', name='request_detail'),
    url(r'^agent/(?P<slug>\w+)/$', views.ServiceRequestDetailView.as_view(), name='request_detail'),
    url(r'^agent/action/$', 'caips.atiar.views.request_action', name='request_action'),
    url(r'^agent/login/$', 'django.contrib.auth.views.login'),
    url(r'^agent/logout/$', 'django.contrib.auth.views.logout', name='agent_logout'),
    
    url(r'^fb177df8d7420a649f1d5d47205e5230/', include('paypal.standard.ipn.urls')),
    url(r'^paypal/(?P<reference_key>\w+)/$', 'caips.atiar.views.paypal', name='paypal'),
    
    url(r'^admin/', include(admin.site.urls)),
)
